package com.share.hibernate.baseDaoSupport;

import java.io.Serializable;
import java.util.List;
import java.util.Map;

public interface BaseDao<T extends Serializable> {
	/**
	 * 增加
	 * @param paramT
	 * @return
	 */
	public abstract String save(T paramT);
	/**
	 * 修改
	 * @param paramT
	 * @return
	 */
	public abstract String update(T paramT);
	/**
	 * 删除
	 * @param paramT
	 * @return
	 */
	public abstract String delete(T paramT);
	/**
	 * 根据id获取单条记录
	 * @param paramInteger
	 * @return
	 */
	public abstract T getById(String paramInteger);
	/**
	 * 查询单个 按HQL语句
	 */
	public T get(String HQL) ;
	/**
	 * 获取所有记录
	 * @return
	 */
	public abstract List<T> find();

	public abstract Integer getAgg();
	
	public abstract Integer getAgg(String HQL);

	public abstract Integer getAgg(String HQL, Map<String, Object> params);

	public abstract List<T> find(Integer maxResults,
			Integer firstResult);
	
	public abstract List<T> find(String HQL, Integer maxResults,
			Integer firstResult);

	public abstract List<T> find(String HQL, Integer maxResults,
			Integer firstResult,  Map<String, Object> params);
}
